package com.base.engine.graphics;

import com.base.engine.error.ColorException;

public class Color4f extends Color3f {

	public static Color4f toColor4f(Color3f color){
		return new Color4f(color.getRed(), color.getGreen(), color.getBlue(), 1.0f);
	}
	
	private float alpha ; 
	
	public Color4f(float r, float g, float b) {
		super(r, g, b);
		setAlpha(1.0f);
	}
	
	public Color4f(float r, float g, float b, float a){
		this(r,g,b);
		setAlpha(a);
	}

	public float getAlpha() {
		return alpha;
	}

	public void setAlpha(float alpha) {
		if(alpha>=0.0f && alpha<=1.0f)
			this.alpha = alpha;
		else
			ColorException.InvalidColorValue("alpha"); 
	}
	
	

}
